package com.parking.bang.rpc.serialize.base;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * General Message Encoder
 * 
 * @author ivan
 *
 */
public class MessageEncoder extends MessageToByteEncoder<Object> {
	private CodecUtil util = null;

	public MessageEncoder(final CodecUtil util) {
		this.util = util;
	}

	protected void encode(final ChannelHandlerContext ctx, final Object msg, final ByteBuf out) throws Exception {
		util.encode(out, msg);
	}
}
